package com.xywy.common.net;

/**
 * Created by Joker on 2014/6/12.
 */
public interface OnResultListener {

    /**
     * 请求成功回调
     *
     * @param resultParser
     * @param resultCode
     */
    <T extends Parser> void onSuccess(T resultParser, int resultCode);

    /**
     * 请求失败回调
     *
     * @param parserResult
     * @param resultCode
     */
    <T extends Parser> void onFailure(T parserResult, int resultCode);

    /**
     * 链接中断
     *
     * @param resultParser
     * @param resultCode
     */
    <T extends Parser> void onShutdown(T resultParser, int resultCode);

    /**
     * 连接池中断
     *
     * @param resultParser
     * @param resultCode
     */
    <T extends Parser> void onPoolShutdown(T resultParser, int resultCode);

    /**
     * 异地登陆
     *
     * @param resultParser
     * @param resultCode
     */
    <T extends Parser> void onErrLogin(T resultParser, int resultCode);

    /**
     * 服务端正在维护
     *
     * @param resultParser
     * @param resultCode
     */
    <T extends Parser> void onErrServer(T resultParser, int resultCode);


    /**
     * 无网络链接时回调
     *
     * @param paramParser
     * @param resultCode
     */
    <T extends Parser> void onNoNetWork(T paramParser, int resultCode);

    /**
     * 返回错误
     *
     * @param resultParser
     * @param resultCode
     * @param <T>
     */
    <T extends Parser> void onErrJson(T resultParser, int resultCode);

    /**
     * 请求超时时回调
     *
     * @param resultParser
     * @param resultCode
     */
    <T extends Parser> void onTimeOut(T resultParser, int resultCode);
}
